package com.small.sentinel;

import com.small.sentinel.node.ClusterNode;
import com.small.sentinel.node.DefaultNode;
import com.small.sentinel.node.EntranceNode;
import com.small.sentinel.slotchain.StringResourceWrapper;

public final class Constants {

    /**
     * 最大资源数量
     */
    public final static int MAX_CONTEXT_NAME_SIZE = 2000;

    /**
     * 最大执行链数量
     */
    public static final int MAX_SLOT_CHAIN_SIZE = 6000;

    /**
     * 根节点资源名称
     */
    public final static String ROOT_ID = "machine-root";

    /**
     * 根节点上下文名称
     */
    public final static String CONTEXT_DEFAULT_NAME = "sentinel_default_context";

    /**
     * 总入站统计信息的虚拟资源标识符
     */
    public final static String TOTAL_IN_RESOURCE_NAME = "__total_inbound_traffic__";

    /**
     * 根节点
     */
    public final static DefaultNode ROOT = new EntranceNode(new StringResourceWrapper(ROOT_ID, EntryType.IN),
            new ClusterNode(ROOT_ID, ResourceTypeConstants.COMMON));

    /**
     * 入站流量的全局统计节点
     */
    public final static ClusterNode ENTRY_NODE = new ClusterNode(TOTAL_IN_RESOURCE_NAME, ResourceTypeConstants.COMMON);
    /**
     * 排序值
     */
    public static final int ORDER_NODE_SELECTOR_SLOT = -10000;

    public static final int ORDER_CLUSTER_BUILDER_SLOT = -9000;

    public static final int ORDER_STATISTIC_SLOT = -7000;

    public static final int ORDER_AUTHORITY_SLOT = -6000;

    public static final int ORDER_FLOW_SLOT = -2000;

    public static final int ORDER_DEGRADE_SLOT = -1000;
}
